package com.web44.ssm.mapper;

import com.web44.ssm.bean.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Title: BookMapper
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/15 13:33
 */
public interface BookMapper {

    @Insert("insert into tbl_book(type,name,description) values(#{type},#{name},#{description})")
    public void saveBook(Book book);

    @Update("update tbl_book set type=#{type},name=#{name},description=#{description} where id =#{id} ")
    public void editBook(Book book);
    @Delete("delete from tbl_book where id=#{id}")
    public void deleteBookById(Integer id);
    @Select("select * from tbl_book where id=#{id}")
    public Book queryBookById(Integer id);

    @Select("select * from tbl_book")
    public List<Book> queryBooks();
}
